<div id="browse-grid">
<span class="page-heading" id="browse">Search Results</span><br />
	<div id="search-input">
		<?php
			echo form_label('Category: ', 'category', array('class' => 'normal-text'));
			$option = array(0 => "Any");
			foreach ($categories as $cat) {
						$option[$cat['category_id']] = $cat['category_name'];
			}
						
			echo form_dropdown('category_id', $option, isset($selectedcat)?$selectedcat:0, 'id = "category_id" class="normal-text" onChange="submitsearch()"');
			echo '&nbsp&nbsp&nbsp&nbsp';
			echo form_label("", "searchfield", array('class' => 'normal-text'));
			$attribute = array(
				'name'		=> 'searchfield',
				'id' 		=> 'searchfield',
				'size' 		=> '40',
				'placeholder' 	=> isset($_POST['search'])?$_POST['search']:'Search',
				'onKeyup'  => 'submitsearch()',
				'class' => 'normal-text',
			);
			echo form_input($attribute);
			echo '&nbsp&nbsp&nbsp&nbsp';
			echo '<div id="search-button"><a href="Javascript:void(0);" onclick = "submitsearch()" ></a></div><br />';			

			echo form_label('Sort By: ', 'sort_by', array('class' => 'normal-text'));
			$option = array(
				'relevance' => 'Profile Preferences',
				'newestfirst' => 'Newest to Oldest',
				'oldestfirst' => 'Oldest to Newest',
				'pricelowtohigh' => 'Price: Low to High',
				'pricehightolow' => 'Price: High to Low',
			);
			
			echo form_dropdown('sort_by', $option, 'relevance', 'id = "sort_by" onChange="submitsearch()"');
			echo '&nbsp&nbsp&nbsp&nbsp';
			echo form_label('Cost: ', 'price', array('class' => 'normal-text'));
			$option = array(
				'both' => 'Any',
				'free' => 'Free',
				'cost' => 'Priced',
			);
			
			echo form_dropdown('price', $option, 'both', 'id = "price" onChange="submitsearch()"');
			echo '&nbsp&nbsp&nbsp&nbsp';
			echo form_label('Status: ', 'show', array('class' => 'normal-text'));
			$option = array(
				'all' => 'Any',
				'reserved' => 'Reserved',
				'available' => 'Available',
			);
			
			echo form_dropdown('show', $option, 'available', 'id = "show" onChange="submitsearch()"');
			
			echo '&nbsp&nbsp&nbsp';
		?>
	</div>

	
	<div class="horizontal-bar"></div>
	<div id="items-grid">
	</div>
	<div id="paginator"></div>
	<div style="height: 30px"></div>
</div>


<?php
	$json = json_encode($searchresult);
	echo '<script type="text/javascript">var searchresults = ' . $json . ';</script>';
	echo '<script type="text/javascript">var base_url = "' . base_url() . '";</script>';
	echo '<script type="text/javascript">var it_url = "' . base_url("/itemdescription/") . '";</script>';

?>